<template>
  <div style="display: inline;">
    <el-button
      v-if="showEdit && displayOp || user.id === row.createBy"
      type="primary"
      size="mini"
      @click="editFun(row.id)"
    >
      编辑
    </el-button>
    <el-button
      v-if="showDetail && displayOp || user.id === row.createBy"
      type="primary"
      size="mini"
      @click="detailFun(row.id)"
    >
      详情
    </el-button>
    <el-button
      v-if="showDel && displayOp || user.id === row.createBy"
      type="danger"
      size="mini"
      @click="delFun(row.id)"
    >
      删除
    </el-button>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  name: 'OperationButtons',
  props: {
    showEdit: {
      type: Boolean,
      default: true
    },
    showDetail: {
      type: Boolean,
      default: true
    },
    showDel: {
      type: Boolean,
      default: true
    },
    row: {
      type: Object
    },
    delFun: {
      type: Function
    },
    lastSearch: {
      type: Object
    },
    detailFun: {
      type: Function
    },
    editFun: {
      type: Function
    }
  },
  data() {
    return {
      path: '',
      edit: '',
      detail: ''
    }
  },
  computed: {
    ...mapGetters([
      'displayOp',
      'user'
    ])
  }
}
</script>

<style scoped>

</style>
